import { Column, Entity } from 'typeorm';
import { BaseEntity } from '../baseEntity';

@Entity()
export class TBlogComment extends BaseEntity {
  @Column({
    type: 'bigint',
    name: 'rootId',
    comment: '根评论id(-1为根评论)',
    default: -1,
  })
  rootId?: number;

  @Column({ type: 'bigint', name: 'articleId', comment: '文章id' })
  articleId: number;

  @Column({ type: 'varchar', name: 'content', comment: '评论内容' })
  content: string;

  @Column({
    type: 'bigint',
    name: 'toCommentId',
    comment: '所回复的目标评论id(没有为-1)',
    default: -1,
  })
  toCommentId?: number;

  @Column({
    type: 'bigint',
    name: 'toCommentUserId',
    comment: '所回复的目标用户id(没有为-1)',
    default: -1,
  })
  toCommentUserId?: number;
}
